Skip to content

feat: add frame-pointers profile option#16742

Open
enricobolzonello wants to merge 1 commit intorust-lang:masterfrom
enricobolzonello:frame-pointers-profile
Open

feat: add frame-pointers profile option#16742
enricobolzonello wants to merge 1 commit intorust-lang:masterfrom
enricobolzonello:frame-pointers-profile

Conversation

@enricobolzonello
Copy link

@enricobolzonello enricobolzonello commented Mar 12, 2026

What does this PR try to resolve?

Allow turning on frame pointers for a particular profile in Cargo.toml by add frame-pointers as a profile setting that maps to -C force-frame-pointers.

Values:

  • "force-on" -> -C force-frame-pointers=yes
  • "force-off" -> -C force-frame-pointers=no
  • "default" -> no-op

Fixes issue #15333.

How to test and review this PR?

Run the tests in tests/testsuite/profiles.rs:

  • frame_pointers_force_on
  • frame_pointers_force_off
  • frame_pointers_unspecified
  • frame_pointers_invalid_value

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-profiles Area: profiles S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2026

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@enricobolzonello enricobolzonello force-pushed the frame-pointers-profile branch 2 times, most recently from e054730 to 2936185 Compare March 17, 2026 17:56
@epage epage added the T-cargo Team: Cargo label Mar 17, 2026
@epage
Copy link
Contributor

epage commented Mar 17, 2026

@rfcbot fcp merge cargo

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Mar 17, 2026

Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Mar 17, 2026
@enricobolzonello enricobolzonello force-pushed the frame-pointers-profile branch 2 times, most recently from 973aa24 to 615d4d3 Compare March 17, 2026 20:20
Add `frame-pointers` as a profile setting that maps to `-C
force-frame-pointers`.
Uses string values (for now `"force-on"`, `"force-off"` and `"default"`)
to allow
future variants to be added.

This allows to turn on frame pointers for a particular profile in
`Cargo.toml`, addressing issue rust-lang#15333.
@weihanglo
Copy link
Member

@rust-rfcbot reviewed

Comment on lines +274 to +275
- `"force-off"`: Don't force frame pointers (the compiler may still emit them based on target defaults).
- `"default"`: Use the compiler's target-specific default.
Copy link
Member

@weihanglo weihanglo Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still a bit confusing. It sounds like depending target just like the default bvehavior. Though I guess it is probably more a rustc issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-build-execution Area: anything dealing with executing the compiler A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-profiles Area: profiles disposition-merge FCP with intent to merge proposed-final-comment-period An FCP proposal has started, but not yet signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cargo Team: Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants